import { createRouter, createWebHashHistory } from 'vue-router'
import LayOut from '@/layout'
import UserLogin from '@/views/login/userLogin.vue'
import HomeView from '../views/HomeView.vue'
import Qumiao from '@/views/Qumiao.vue'
import Kucun from '@/views/Kucun.vue'
import Caozuo from '@/views/Caozuo.vue'
import Xitong from '@/views/Xitong.vue'

let routes = [
  {
    path: '/',
    component: LayOut,
    children: [{
      path: '/',
      name: "首页",
      component: HomeView
    }]
  },
  {
    path: '/Qumiao',
    component: LayOut,
    children: [{
      path: '/Qumiao',
      name: "取苗",
      component: Qumiao
    },{
      path: 'ZhongleiQumiao',
      name: "种类取苗",
      component: () => import('@/views/qumiao/ZhongleiQumiao.vue')
    },{
      path: 'ZuijinQumiao',
      name: "最近取苗",
      component: () => import('@/views/qumiao/ZuijinQumiao.vue')
    },{
      path: 'ChangyongQumiao',
      name: "常用取苗",
      component: () => import('@/views/qumiao/ChangyongQumiao.vue')
    },{
      path: 'QumiaoRizhi',
      name: "取苗日志",
      component: () => import('@/views/qumiao/QumiaoRizhi.vue')
    }]
  },
  {
    path: '/Kucun',
    component: LayOut,
    children: [{
      path: '/Kucun',
      name: "库存",
      component: Kucun
    },{
      path: 'DangqianKucun',
      name: "当前库存",
      component: () => import('@/views/kucun/DangqianKucun.vue')
    },{
      path: 'KucunTiaozheng',
      name: "库存调整",
      component: () => import('@/views/kucun/KucunTiaozheng.vue')
    }]
  },
  {
    path: '/Caozuo',
    component: LayOut,
    children: [{
      path: '/Caozuo',
      name: "操作",
      component: Caozuo
    },{
      path: 'ShangBan',
      name: "上班",
      component: () => import('@/views/caozuo/ShangBan.vue')
    },{
      path: 'XiaBan',
      name: "下班",
      component: () => import('@/views/caozuo/XiaBan.vue')
    },{
      path: 'JinjiChuli',
      name: "紧急处理",
      component: () => import('@/views/caozuo/JinjiChuli.vue')
    }]
  },
  {
    path: '/Xitong',
    component: LayOut,
    children: [{
      path: '/Xitong',
      name: "系统",
      component: Xitong
    },{
      path: 'JiankongShipin',
      name: "监控视频",
      component: () => import('@/views/xitong/JiankongShipin.vue')
    }]
  },
  {
    path: '/about',
    component: LayOut,
    children: [{
      path: '/about',
      name: "关于",
      component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    }]
  },
  {
    path: '/login',
    name: "登录",
    component: UserLogin
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
